<template>
  <div>
    <navHeader v-if="isalive&&this.$route.path!='/'"/>
    <myloading v-if="this.$root.loading"></myloading>
    <nuxt/> <!-- 内容主体 -->

  </div>
</template>
<script>
import navHeader from '~/components/common/navHeader.vue';
import myloading from '~/components/common/loading.vue';

export default {
  data() {
    return {
      isalive: true,
    };
  },
  components: {
    navHeader,
    myloading,
  },
  watch: {
    $route(to, from) {
      if (from.name == 'index') {
        this.reload();
      }
    },
  },
  methods: {
    reload() {
      this.isalive = false;
      this.$nextTick(() => {
        this.isalive = true;
      });
    },
  },
};
</script>
